﻿namespace MicroCloud.Authorization
{
    #region "功能信息处理器接口"
    /// <summary>
    /// 功能信息处理器接口
    /// </summary>
    public interface IFunctionHandler
    {
        #region "方法"
        #region "从程序集中获取功能信息(如MVC的Controller-Action)"
        /// <summary>
        /// 从程序集中获取功能信息
        /// <para>如MVC的Controller-Action</para>
        /// </summary>
        void Initialize();
        #endregion
        #region "获取所有功能类型"
        /// <summary>
        /// 获取所有功能类型
        /// </summary>
        /// <returns></returns>
        Type[] GetAllFunctionTypes();
        #endregion
        #region "查找指定功能的所有功能点方法"
        /// <summary>
        /// 查找指定功能的所有功能点方法  
        /// </summary>
        /// <param name="functionType">功能类型</param>
        /// <returns></returns>
        MethodInfo[] GetMethodInfos(Type functionType);
        #endregion
        #region "查找指定编号的功能信息"
        /// <summary>
        /// 查找指定编号的功能信息
        /// </summary>
        /// <param name="functionId">功能编号</param>
        /// <returns>功能信息</returns>
        IFunction GetFunction(long functionId);
        #endregion
        #region "查找指定条件的功能信息"
        /// <summary>
        /// 查找指定条件的功能信息
        /// </summary>
        /// <param name="area">区域</param>
        /// <param name="controller">控制器</param>
        /// <param name="action">功能方法</param>
        /// <returns>功能信息</returns>
        IFunction GetFunction(string area, string controller, string action);
        #endregion
        #region "刷新功能信息缓存"
        /// <summary>
        /// 刷新功能信息缓存
        /// </summary>
        void RefreshCache();
        #endregion
        #region "清空功能信息缓存"
        /// <summary>
        /// 清空功能信息缓存
        /// </summary>
        void ClearCache();
        #endregion

        #endregion

    }
    #endregion

}
